﻿using System;
using System.Collections;
using System.Configuration;
using System.Diagnostics;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

namespace Volunteer
{
    public partial class VolInfoView : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void SqlDataSource1_Updating(object sender, SqlDataSourceCommandEventArgs e)
        {
            //Grab TermDate column and send non-null value to database since object has to contain value
            for (int x = 0; x < e.Command.Parameters.Count - 1; x++)
            {
                if (e.Command.Parameters[x].ParameterName.ToUpper()=="@TERMDATE")
                {
                    if (e.Command.Parameters[x].Value == null)
                        {
                            e.Command.Parameters[x].Value = "1/1/1900";
                        }
                }

                //Trace.Write(e.Command.Parameters[x].ParameterName);
                //Trace.Write(e.Command.Parameters[x].Value.ToString());
            }
        }

    }

    
}
